<html lang="zh-CN"><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>姚老师信奥网 - 信息学奥赛学习平台</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#4A80F0', // 主色调：鲜明的蓝色
                        secondary: '#6C63FF', // 辅助色：紫色
                        syntax: '#FF9800', // 语法部分：橙色
                        algorithm: '#2ECC71', // 算法部分：绿色
                        datastructure: '#9C27B0', // 数据结构部分：深紫色
                        darkbg: '#F8FAFC', // 浅灰白背景
                        cardbg: '#FFFFFF', // 卡片背景
                        hoverbg: '#F0F2F5', // 悬停背景
                    },
                    fontFamily: {
                        mono: ['Consolas', 'Monaco', 'Courier New', 'monospace'],
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .hover-scale {
                @apply transition-transform duration-300 hover:scale-[1.02];
            }
            .category-bg {
                @apply bg-gradient-to-r from-primary/5 to-primary/10;
            }
            .subcategory-bg {
                @apply bg-gradient-to-r from-secondary/5 to-secondary/10;
            }
            .card-shadow {
                @apply shadow-sm hover:shadow-md transition-shadow duration-300;
            }
            .nav-item {
                @apply text-gray-700 hover:text-primary transition-colors duration-200;
            }
            .topic-card {
                @apply bg-cardbg rounded-lg p-5 card-shadow hover-scale;
            }
            .subtopic-item {
                @apply bg-white rounded-md p-3 border border-gray-100 hover:border-primary/50 transition-all duration-200 cursor-pointer;
            }
            .topic-header {
                @apply text-xl font-bold text-primary mb-4 flex items-center;
            }
            .subtopic-header {
                @apply font-semibold text-secondary mb-3;
            }
            .site-title {
                @apply text-2xl font-bold text-primary tracking-tight;
            }
        }
    </style>
</head>
<body class="bg-darkbg text-gray-800 font-sans min-h-screen">
    <!-- 顶部导航栏 -->
    <header class="bg-white shadow-sm sticky top-0 z-50">
        <div class="container mx-auto px-4 py-3 flex justify-between items-center">
            <div class="flex items-center space-x-3">
                <i class="fa fa-code text-primary text-3xl"></i>
                <h1 class="site-title">姚老师信奥网</h1>
            </div>
            <div class="hidden md:flex items-center space-x-6">
                <a href="#" class="nav-item">首页</a>
                <a href="#" class="nav-item">课程</a>
                <a href="#" class="nav-item">题库</a>
                <a href="#" class="nav-item">关于我们</a>
            </div>
            <div class="flex items-center space-x-4">
                <!-- 搜索框 -->
                <div class="relative hidden md:block">
                    <input type="text" id="search-input" placeholder="搜索算法、数据结构..." class="pl-10 pr-4 py-2 rounded-md bg-darkbg border border-gray-200 focus:outline-none focus:border-primary text-gray-700 w-64">
                    <button id="search-button" class="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-primary">
                        <i class="fa fa-search"></i>
                    </button>
                </div>
                <div class="md:hidden">
                    <button class="text-gray-700">
                        <i class="fa fa-bars text-xl"></i>
                    </button>
                </div>
            </div>
        </div>
        <!-- 移动端搜索框 -->
        <div class="md:hidden px-4 pb-3">
            <div class="relative">
                <input type="text" id="mobile-search-input" placeholder="搜索算法、数据结构..." class="pl-10 pr-4 py-2 rounded-md bg-darkbg border border-gray-200 focus:outline-none focus:border-primary text-gray-700 w-full">
                <button id="mobile-search-button" class="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-primary">
                    <i class="fa fa-search"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 主要内容区 -->
    <main class="container mx-auto px-4 py-8">
        <!-- 搜索结果区域 -->
        <div id="search-results" class="hidden mb-8 bg-white rounded-lg p-5 card-shadow">
            <div class="flex items-center justify-between mb-4">
                <h2 class="text-xl font-bold text-primary">搜索结果</h2>
                <button id="close-search" class="text-gray-500 hover:text-primary">
                    <i class="fa fa-times"></i>
                </button>
            </div>
            <div id="search-results-content" class="space-y-4">
                <!-- 搜索结果将在这里动态生成 -->
                <p class="text-gray-500 italic">请输入关键词进行搜索</p>
            </div>
        </div>

        <!-- 介绍卡片 -->
        <div class="bg-white rounded-lg p-6 mb-8 card-shadow">
            <h2 class="text-2xl font-bold text-primary mb-4">信息学奥赛学习平台</h2>
            <p class="text-gray-700 mb-6">
                欢迎来到姚老师信奥网！这里提供丰富的信息学奥赛学习资源，包括语法知识、经典算法和数据结构的详细讲解及案例模板。
            </p>
            <div class="flex flex-wrap gap-4">
                <a href="#syntax" class="bg-syntax/10 hover:bg-syntax/20 text-syntax px-4 py-2 rounded-md transition-all flex items-center hover-scale">
                    <i class="fa fa-code mr-2"></i> 语法基础
                </a>
                <a href="#algorithm" class="bg-algorithm/10 hover:bg-algorithm/20 text-algorithm px-4 py-2 rounded-md transition-all flex items-center hover-scale">
                    <i class="fa fa-cogs mr-2"></i> 算法设计
                </a>
                <a href="#datastructure" class="bg-datastructure/10 hover:bg-datastructure/20 text-datastructure px-4 py-2 rounded-md transition-all flex items-center hover-scale">
                    <i class="fa fa-database mr-2"></i> 数据结构
                </a>
            </div>
        </div>
        <div class="bg-white rounded-lg p-6 mb-8 card-shadow">
            <h2 class="text-2xl font-bold text-primary mb-4">csp初赛备考模块</h2>
            <p class="text-gray-700 mb-6">
                点击进入csp初赛备考模块。
            </p>
            <div class="flex flex-wrap gap-4">
                <a href="cspchusai.html" target="_blank" class="bg-syntax/10 hover:bg-syntax/20 text-syntax px-4 py-2 rounded-md transition-all flex items-center hover-scale">
                    <i class="fa fa-code mr-2"></i> 点击进入
                </a>
                
            </div>
        </div>

        <!-- 内容分类部分 -->
        <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
            <!-- 语法部分 -->
            <section id="syntax" class="topic-card">
                <div class="category-bg p-3 rounded-lg mb-4">
                    <h3 class="topic-header">
                        <i class="fa fa-code mr-2"></i> 语法基础
                    </h3>
                </div>
                <div class="space-y-4">
                    <div class="subcategory-bg p-3 rounded-lg">
                        <h4 class="subtopic-header">基础语法</h4>
                        <div class="grid grid-cols-2 gap-3">
                            <a href="yufajichu/jichuyufa/bianliang.html" target="_blank" class="subtopic-item" data-category="syntax" data-subcategory="基础语法" data-name="变量与数据类型">
                                <div>
                                    <span class="text-sm">变量与数据类型</span>
                                </div>
                            </a>
                            <a href="yufajichu/jichuyufa/tiaojian.html" target="_blank">
                            <div class="subtopic-item" data-category="syntax" data-subcategory="基础语法" data-name="条件语句">
                                <span class="text-sm">条件语句</span>
                            </div>
                            </a>
                            <a href="yufajichu/jichuyufa/xunhuan.html" target="_blank">
                            <div class="subtopic-item" data-category="syntax" data-subcategory="基础语法" data-name="循环结构">
                                <span class="text-sm">循环结构</span>
                            </div>
                            </a>
                            <a href="yufajichu/jichuyufa/hanshu.html" target="_blank">
                            <div class="subtopic-item" data-category="syntax" data-subcategory="基础语法" data-name="函数定义">
                                <span class="text-sm">函数定义</span>
                            </div>
                            </a>
                        </div>
                    </div>
                    
                    <div class="subcategory-bg p-3 rounded-lg">
                        <h4 class="subtopic-header">进阶语法</h4>
                        <div class="grid grid-cols-2 gap-3">
                            <a href="yufajichu/jinjieyufa/digui.html" target="_blank" class="subtopic-item" data-category="syntax" data-subcategory="进阶语法" data-name="递归算法">
                                <div>
                                    <span class="text-sm">递归算法</span>
                                </div>
                            </a>
                            <a href="yufajichu/jinjieyufa/wenjian.html" target="_blank">
                            <div class="subtopic-item" data-category="syntax" data-subcategory="进阶语法" data-name="文件操作">
                                <span class="text-sm">文件操作</span>
                            </div>
                            </a>
                            <a href="yufajichu/jinjieyufa/weiyunsuan.html" target="_blank">
                            <div class="subtopic-item" data-category="syntax" data-subcategory="进阶语法" data-name="位运算">
                                <span class="text-sm">位运算</span>
                            </div>
                            </a>
                            <a href="yufajichu/jinjieyufa/ziFuChuan.html" target="_blank">
                            <div class="subtopic-item" data-category="syntax" data-subcategory="进阶语法" data-name="字符串处理">
                                <span class="text-sm">字符串处理</span>
                            </div>
                            </a>
                        </div>
                    </div>
                    
                    <div class="subcategory-bg p-3 rounded-lg">
                        <h4 class="subtopic-header">输入输出</h4>
                        <div class="grid grid-cols-2 gap-3">
                            <a href="yufajichu/shurushuchu/shurushuchu.html" target="_blank" >
                            <div class="subtopic-item" data-category="syntax" data-subcategory="输入输出" data-name="标准输入输出">
                                <span class="text-sm">标准输入输出</span>
                            </div>
                            </a>
                            <a href="yufajichu/shurushuchu/geshihuashuru.html" target="_blank">
                            <div class="subtopic-item" data-category="syntax" data-subcategory="输入输出" data-name="格式化输入输出">
                                <span class="text-sm">格式化输入输出</span>
                            </div>
                            </a>
                            <div class="subtopic-item" data-category="syntax" data-subcategory="输入输出" data-name="文件读写">
                                <span class="text-sm">文件读写</span>
                            </div>
                            <div class="subtopic-item" data-category="syntax" data-subcategory="输入输出" data-name="字符串流">
                                <span class="text-sm">字符串流</span>
                            </div>
                        </div>
                    </div>
                </div>
            </section>

            <!-- 算法部分 -->
            <section id="algorithm" class="topic-card">
                <div class="category-bg p-3 rounded-lg mb-4">
                    <h3 class="topic-header">
                        <i class="fa fa-cogs mr-2"></i> 算法设计
                    </h3>
                </div>
                <div class="space-y-4">
                    <div class="subcategory-bg p-3 rounded-lg">
                        <h4 class="subtopic-header">排序算法</h4>
                        <div class="grid grid-cols-2 gap-3">
                            <a href="suanfajichu/paixu/maopao.html" target="_blank">
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="排序算法" data-name="冒泡排序">
                                <span class="text-sm">冒泡排序</span>
                            </div>
                            </a>
                            <a href="suanfajichu/paixu/xuanze.html" target="_blank">
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="排序算法" data-name="选择排序">
                                <span class="text-sm">选择排序</span>
                            </div>
                            </a>
                            <a href="suanfajichu/paixu/charu.html" target="_blank">
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="排序算法" data-name="插入排序">
                                <span class="text-sm">插入排序</span>
                            </div>
                            </a>
                            <a href="suanfajichu/paixu/kuaipai.html" target="_blank">
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="排序算法" data-name="快速排序">
                                <span class="text-sm">快速排序</span>
                            </div>
                            </a>
                            <a href="suanfajichu/paixu/guibing.html" target="_blank">
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="排序算法" data-name="归并排序">
                                <span class="text-sm">归并排序</span>
                            </div>
                            </a>
                            <a href="suanfajichu/paixu/duipaixu.html" target="_blank">
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="排序算法" data-name="堆排序">
                                <span class="text-sm">堆排序</span>
                            </div>
                            </a>
                        </div>
                    </div>
                    
                    <div class="subcategory-bg p-3 rounded-lg">
                        <h4 class="subtopic-header">搜索算法</h4>
                        <div class="grid grid-cols-2 gap-3">
                            <a href="suanfajichu/sousuo/xianxingsousuo.html" target="_blank">
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="搜索算法" data-name="线性搜索">
                                <span class="text-sm">线性搜索</span>
                            </div>
                            </a>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="搜索算法" data-name="二分搜索">
                                <span class="text-sm">二分搜索</span>
                            </div>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="搜索算法" data-name="广度优先搜索">
                                <span class="text-sm">广度优先搜索</span>
                            </div>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="搜索算法" data-name="深度优先搜索">
                                <span class="text-sm">深度优先搜索</span>
                            </div>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="搜索算法" data-name="A*算法">
                                <span class="text-sm">A*算法</span>
                            </div>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="搜索算法" data-name="floyd算法">
                                <span class="text-sm">floyd算法</span>
                            </div>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="搜索算法" data-name="Dijkstra算法">
                                <span class="text-sm">Dijkstra算法</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="subcategory-bg p-3 rounded-lg">
                        <h4 class="subtopic-header">动态规划</h4>
                        <div class="grid grid-cols-2 gap-3">
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="动态规划" data-name="背包问题">
                                <span class="text-sm">背包问题</span>
                            </div>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="动态规划" data-name="最长公共子序列">
                                <span class="text-sm">最长公共子序列</span>
                            </div>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="动态规划" data-name="最短路径">
                                <span class="text-sm">最短路径</span>
                            </div>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="动态规划" data-name="斐波那契数列">
                                <span class="text-sm">斐波那契数列</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="subcategory-bg p-3 rounded-lg">
                        <h4 class="subtopic-header">其他算法</h4>
                        <div class="grid grid-cols-2 gap-3">
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="其他算法" data-name="贪心算法">
                                <span class="text-sm">贪心算法</span>
                            </div>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="其他算法" data-name="分治算法">
                                <span class="text-sm">分治算法</span>
                            </div>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="其他算法" data-name="回溯算法">
                                <span class="text-sm">回溯算法</span>
                            </div>
                            <div class="subtopic-item" data-category="algorithm" data-subcategory="其他算法" data-name="模拟算法">
                                <span class="text-sm">模拟算法</span>
                            </div>
                        </div>
                    </div>
                </div>
            </section>

            <!-- 数据结构部分 -->
            <section id="datastructure" class="topic-card">
                <div class="category-bg p-3 rounded-lg mb-4">
                    <h3 class="topic-header">
                        <i class="fa fa-database mr-2"></i> 数据结构
                    </h3>
                </div>
                <div class="space-y-4">
                    <div class="subcategory-bg p-3 rounded-lg">
                        <h4 class="subtopic-header">线性结构</h4>
                        <div class="grid grid-cols-2 gap-3">
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="线性结构" data-name="数组">
                                <span class="text-sm">数组</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="线性结构" data-name="链表">
                                <span class="text-sm">链表</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="线性结构" data-name="栈">
                                <span class="text-sm">栈</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="线性结构" data-name="队列">
                                <span class="text-sm">队列</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="subcategory-bg p-3 rounded-lg">
                        <h4 class="subtopic-header">树结构</h4>
                        <div class="grid grid-cols-2 gap-3">
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="树结构" data-name="二叉树">
                                <span class="text-sm">二叉树</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="树结构" data-name="二叉搜索树">
                                <span class="text-sm">二叉搜索树</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="树结构" data-name="AVL树">
                                <span class="text-sm">AVL树</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="树结构" data-name="红黑树">
                                <span class="text-sm">红黑树</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="subcategory-bg p-3 rounded-lg">
                        <h4 class="subtopic-header">图结构</h4>
                        <div class="grid grid-cols-2 gap-3">
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="图结构" data-name="图的表示">
                                <span class="text-sm">图的表示</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="图结构" data-name="深度优先遍历">
                                <span class="text-sm">深度优先遍历</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="图结构" data-name="广度优先遍历">
                                <span class="text-sm">广度优先遍历</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="图结构" data-name="最短路径算法">
                                <span class="text-sm">最短路径算法</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="subcategory-bg p-3 rounded-lg">
                        <h4 class="subtopic-header">高级数据结构</h4>
                        <div class="grid grid-cols-2 gap-3">
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="高级数据结构" data-name="哈希表">
                                <span class="text-sm">哈希表</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="高级数据结构" data-name="并查集">
                                <span class="text-sm">并查集</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="高级数据结构" data-name="线段树">
                                <span class="text-sm">线段树</span>
                            </div>
                            <div class="subtopic-item" data-category="datastructure" data-subcategory="高级数据结构" data-name="字典树">
                                <span class="text-sm">字典树</span>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </main>

    <!-- 页脚 -->
    <footer class="bg-white border-t border-gray-200 mt-12 py-8">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <h3 class="text-lg font-semibold text-primary mb-4">姚老师信奥网</h3>
                    <p class="text-gray-600 text-sm">
                        专注于信息学奥赛教学，提供专业的学习资源和指导，帮助学生在竞赛中取得优异成绩。
                    </p>
                </div>
                <div>
                    <h3 class="text-lg font-semibold text-gray-800 mb-4">快速链接</h3>
                    <ul class="space-y-2 text-sm">
                        <li><a href="#" class="text-gray-600 hover:text-primary">首页</a></li>
                        <li><a href="#" class="text-gray-600 hover:text-primary">课程</a></li>
                        <li><a href="#" class="text-gray-600 hover:text-primary">题库</a></li>
                        <li><a href="#" class="text-gray-600 hover:text-primary">关于我们</a></li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-lg font-semibold text-gray-800 mb-4">联系我们</h3>
                    <ul class="space-y-2 text-sm">
                        <li class="flex items-center"><i class="fa fa-envelope-o mr-2 text-primary"></i> <a href="mailto:contact@yaoteacher.com" class="text-gray-600 hover:text-primary">contact@yaoteacher.com</a></li>
                        <li class="flex items-center"><i class="fa fa-phone mr-2 text-primary"></i> <span class="text-gray-600">400-123-4567</span></li>
                        <li class="flex items-center"><i class="fa fa-weixin mr-2 text-primary"></i> <span class="text-gray-600">yaoteacher</span></li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-lg font-semibold text-gray-800 mb-4">关注我们</h3>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-primary"><i class="fa fa-weibo text-xl"></i></a>
                        <a href="#" class="text-gray-400 hover:text-primary"><i class="fa fa-wechat text-xl"></i></a>
                        <a href="#" class="text-gray-400 hover:text-primary"><i class="fa fa-qq text-xl"></i></a>
                    </div>
                    <p class="text-gray-600 text-sm mt-4">
                        关注我们获取最新资讯和学习资源
                    </p>
                </div>
            </div>
            <div class="border-t border-gray-200 mt-8 pt-6 text-center text-gray-500 text-sm">
                <p>© 2025 姚老师信奥网 版权所有</p>
            </div>
        </div>
    </footer>

    <script>
        // 搜索功能
        const searchInput = document.getElementById('search-input');
        const mobileSearchInput = document.getElementById('mobile-search-input');
        const searchButton = document.getElementById('search-button');
        const mobileSearchButton = document.getElementById('mobile-search-button');
        const searchResults = document.getElementById('search-results');
        const searchResultsContent = document.getElementById('search-results-content');
        const closeSearch = document.getElementById('close-search');
        
        // 模拟搜索数据
        const searchData = [
            { category: 'syntax', name: '变量与数据类型', description: '介绍基本变量类型和数据结构' },
            { category: 'syntax', name: '递归算法', description: '递归思想和实现方法' },
            { category: 'algorithm', name: '快速排序', description: '分治思想的典型应用' },
            { category: 'algorithm', name: '广度优先搜索', description: '图的遍历算法' },
            { category: 'datastructure', name: '二叉树', description: '基础树结构' },
            { category: 'datastructure', name: '哈希表', description: '高效的查找数据结构' }
        ];
        
        function performSearch(query) {
            if (!query.trim()) {
                searchResultsContent.innerHTML = '<p class="text-gray-500 italic">请输入关键词进行搜索</p>';
                return;
            }
            
            const results = searchData.filter(item => 
                item.name.toLowerCase().includes(query.toLowerCase()) || 
                item.description.toLowerCase().includes(query.toLowerCase())
            );
            
            if (results.length === 0) {
                searchResultsContent.innerHTML = '<p class="text-gray-500 italic">没有找到相关结果</p>';
            } else {
                searchResultsContent.innerHTML = results.map(result => `
                    <div class="bg-white p-3 rounded-md border border-gray-100 hover:border-primary/50 transition-all">
                        <h4 class="font-medium text-primary">${result.name}</h4>
                        <p class="text-gray-600 text-sm mt-1">${result.description}</p>
                        <div class="mt-2 text-xs text-gray-500">
                            <span class="px-2 py-0.5 rounded-full bg-${result.category}/10 text-${result.category}">${result.category}</span>
                        </div>
                    </div>
                `).join('');
            }
            
            searchResults.classList.remove('hidden');
            // 平滑滚动到搜索结果
            searchResults.scrollIntoView({ behavior: 'smooth' });
        }
        
        searchButton.addEventListener('click', () => performSearch(searchInput.value));
        mobileSearchButton.addEventListener('click', () => performSearch(mobileSearchInput.value));
        searchInput.addEventListener('keydown', (e) => {
            if (e.key === 'Enter') performSearch(searchInput.value);
        });
        mobileSearchInput.addEventListener('keydown', (e) => {
            if (e.key === 'Enter') performSearch(mobileSearchInput.value);
        });
        closeSearch.addEventListener('click', () => {
            searchResults.classList.add('hidden');
        });
        
        // 子主题点击事件
        document.querySelectorAll('.subtopic-item').forEach(item => {
            item.addEventListener('click', (event) => {
                //event.preventDefault();
                //const category = item.dataset.category;
                //const subcategory = item.dataset.subcategory;
                //const name = item.dataset.name;
                
                // 这里可以添加点击后的具体操作，例如跳转到详情页
                //alert(`你点击了：${category} > ${subcategory} > ${name}`);
            });
        });
        
        // 平滑滚动
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                
                const targetId = this.getAttribute('href');
                if (targetId === '#') return;
                
                const targetElement = document.querySelector(targetId);
                if (targetElement) {
                    targetElement.scrollIntoView({
                        behavior: 'smooth'
                    });
                }
            });
        });
        
        // 导航栏滚动效果
        window.addEventListener('scroll', function() {
            const header = document.querySelector('header');
            if (window.scrollY > 10) {
                header.classList.add('shadow-md');
                header.classList.remove('shadow-sm');
            } else {
                header.classList.remove('shadow-md');
                header.classList.add('shadow-sm');
            }
        });
        
        // 内容区块动画
        const observer = new IntersectionObserver((entries) => {
            entries.forEach(entry => {
                if (entry.isIntersecting) {
                    entry.target.classList.add('opacity-100', 'translate-y-0');
                    entry.target.classList.remove('opacity-0', 'translate-y-4');
                }
            });
        }, { threshold: 0.1 });
        
        document.querySelectorAll('.topic-card').forEach(card => {
            card.classList.add('transition-all', 'duration-700', 'opacity-0', 'translate-y-4');
            observer.observe(card);
        });
    </script>

    </body></html>